import request from '@/utils/request'
export default{
  // 对章节进行增删改查的api方法
  // 新增章节
  addChapter(chapter) {
    return request({
      url: 'admin/edu/chapter/addChapter',
      method: 'post',
      data: chapter
    })
  },
  // 修改章节
  editChapter(chapter) {
    return request({
      url: 'admin/edu/chapter/editChapter',
      method: 'put',
      data: chapter
    })
  },
  // 查询章节
  getChapter(id) {
    return request({
      url: `admin/edu/chapter/getChapterById/${id}`,
      method: 'get'
    })
  },
  // 删除章节
  deleteChapter(id) {
    return request({
      url: `admin/edu/chapter/deleteChapter/${id}`,
      method: 'delete'
    })
  },
  // 根据课程id查询章节及课时信息
  getChapters(courseId) {
    return request({
      url: `admin/edu/chapter/getChapter/${courseId}`,
      method: 'get'
    })
  }

}
